<?php
$bgs_url = '';
$cbgs_url = 'plugin/qt_hint_sound/bgs.mp3';
$rbgs_url = 'plugin/qt_hint_sound/' . $route . '.mp3';
$fbgs_url = "plugin/qt_hint_sound/forum-{$fid}.mp3";
$tbgs_url = "plugin/qt_hint_sound/thread-{$tid}.mp3";
if($route == 'forum' && file_exists(APP_PATH. $fbgs_url)) {
$bgs_url = $fbgs_url;
} elseif($route == 'thread' && file_exists(APP_PATH . $tbgs_url)) {
$bgs_url = $tbgs_url;
} elseif(file_exists(APP_PATH . $rbgs_url)) {
$bgs_url = $rbgs_url;
} else {
$bgs_url = '/xiunobbs/'.$cbgs_url;
}
?>
<script>
var audio = new Audio("<?php echo $bgs_url; ?>");
audio.volume = 0.2;
audio.play();
</script>
